﻿<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="../helpproject.xsl" ?>
<topic template="Default" lasteditedby="Geert" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../helpproject.xsd">
  <title translate="true">Configuring dependency injection</title>
  <keywords>
    <keyword translate="true">dependency injection</keyword>
    <keyword translate="true">DI</keyword>
    <keyword translate="true">IoC</keyword>
    <keyword translate="true">mvc</keyword>
    <keyword translate="true">ServiceLocator</keyword>
  </keywords>
  <body>
    <header>
      <para styleclass="Heading1"><text styleclass="Heading1" translate="true">Configuring dependency injection</text></para>
    </header>
    <para styleclass="Normal"><text styleclass="Normal" translate="true">The </text><text styleclass="Normal" style="font-style:italic;" translate="true">ServiceLocator</text><text styleclass="Normal" translate="true"> is a very powerful dependency injection class. To allow the ASP.NET MVC to use the </text><text styleclass="Normal" style="font-style:italic;" translate="true">ServiceLocator</text><text styleclass="Normal" translate="true"> as dependency resolver, simply call the following in the global.asax class:</text></para>
    <para styleclass="Code Example"><text styleclass="Code Example" style="font-weight:normal; font-style:normal; text-decoration:none; color:#000000;" translate="true">Catel.Mvc.DependencyInjectionConfig.RegisterServiceLocatorAsDependencyResolver();</text></para>
  </body>
</topic>
